package com.itheima.health.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.constant.MessageConstant;
import com.itheima.health.entity.Result;
import com.itheima.health.service.MemberService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("/user")
@RestController
public class MemberController {

    @Reference
    private MemberService memberService;

    //根据会员的男女进行查找
    @RequestMapping("/findByAgeforGroup")
    public Result findByAgeforGroup(){
        Map<String, Object> map = memberService.findByAgeforGroup();
        return new Result(true, MessageConstant.GET_USERNAME_SUCCESS,map);
    }
    //根据会员的年龄进行查找
    @RequestMapping("/findBySexforGroup")
    public Result findBySexforGroup(){
        Map<String, Object> map = memberService.findBySexforGroup();
        return new Result(true, MessageConstant.GET_USERNAME_SUCCESS,map);
    }
}
